addMenuProvider

open fun addMenuProvider(@NonNull provider: @NonNull MenuProvider)(source)

Adds the given MenuProvider to the helper.

Parameters

provider

the MenuProvider to be added


open fun addMenuProvider(@NonNull provider: @NonNull MenuProvider, @NonNull owner: @NonNull LifecycleOwner)(source)

Adds the given MenuProvider to the helper. This MenuProvider will be removed once the given LifecycleOwner receives an Lifecycle.Event.ON_DESTROY event.

Parameters

provider

the MenuProvider to be added

owner

the Lifecycle owner whose state will determine the removal of the provider


open fun addMenuProvider(@NonNull provider: @NonNull MenuProvider, @NonNull owner: @NonNull LifecycleOwner, state: @NonNull Lifecycle.State)(source)

Adds the given MenuProvider to the helper once the given LifecycleOwner reaches the given Lifecycle.State. This MenuProvider will be removed once the given LifecycleOwner goes down from the given Lifecycle.State or receives an Lifecycle.Event.ON_DESTROY event.

Parameters

provider

the MenuProvider to be added

state

the Lifecycle.State to check for automated addition/removal

owner

the Lifecycle owner whose state will determine the removal of the provider